#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {
    int seed = 1000;
    int numPlayer = 2;
    int r, i;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
	int loopCnt = 10; //how many loops I want to test this over and over
	int resultCheck[27] = {0, 2, 5, 8, 0, 3, 6, 6, 5, 4, 4, 5, 4, 4, 3, 4, 3, 5, 3, 5, 3, 4, 2, 5, 4, 4, 4};//What the cards should return (in order)
	int arSz = 27;
	int theResult;

#if (NOISY_TEST == 1)
printf ("TESTING getCost():\n");
#endif

	
	for(i=0; i<loopCnt; i++) {

		for(i=0; i<arSz; i++){
  
			memset(&G, 23, sizeof(struct gameState));   // clear the game state
			r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

			theResult = getCost(i);
	
			#if (NOISY_TEST == 1)
				printf("Cost = %d, expected = %d\n", theResult, resultCheck[i]);//for curse
			#endif
			
			assert(theResult == resultCheck[i]); // check if the number of coins is correct
		}
	}
	
	printf("All tests passed!\n");

    return 0;
}
